import service from "../utils/request"

// 添加部门
export const addRequest = (data: any) => {
  return service.post("/admin/department/add", data)
}
// 删除部门
export const delRequest = (id: any) => {
  return service.delete(`/admin/department/${id}`)
}
// 编辑部门
export const editRequest = (data: any) => {
  return service.put("/admin/department/update", data)
}
// 分页查询部门
export const pageRequest = (query: any) => {
  return service.get("/admin/department/list", {
    params: query,
  })
}
// 查询部门详情
export const getDetail = (id: number) => {
  return service.get(`/admin/department/${id}`)
}
// 更新部门状态
export const updateStatus = (id: number, status: number) => {
  return service.put(`/admin/department/${id}/status?status=${status}`)
}
